//
//  RBAboutVC.m
//  zhongzhenglu
//
//  Created by XL on 2022/8/11.
//

#import "RBAboutVC.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import <Masonry.h>
#import "RBThemeConfig.h"
#import <UIColor+YYAdd.h>
#import <UIView+YYAdd.h>
#import "RBPager.h"
#import <UINavigationController+FDFullscreenPopGesture.h>
#import "RanTool.h"
#import <YYLabel.h>
#import "NSMutableAttributedString+RBAdd.h"
#import "LCNetWork.h"

@interface RBAboutVC ()

@end

@implementation RBAboutVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
}

#pragma mark - Private

- (void)setup
{
    self.title = @"关于我们";
    self.view.backgroundColor = [RBThemeConfig bgGrayColor];
    
    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
    
    NSString *name = infoDict[@"CFBundleDisplayName"];
    NSString *version = infoDict[@"CFBundleShortVersionString"];
    
    {
        UIImageView *view = UIImageView.new;
        view.backgroundColor = UIColor.blueColor;
        [self.view view_addView:view withHeight:Zoom(69) width:Zoom(69) top:Zoom(83) bottom:CGFLOAT_MIN left:CGFLOAT_MIN right:CGFLOAT_MIN centerX:YES];
    }
    {
        UILabel *view = [RanTool labelWithFontSize:Zoom(16) weight:2 color:[RBThemeConfig textBlackColor] align:1 text:name];
        [self.view view_addView:view withHeight:CGFLOAT_MIN width:kRBMainScreenWidth top:Zoom(11) bottom:CGFLOAT_MIN left:0 right:0 centerX:0];
        
    }
    {
        UILabel *view = [RanTool labelWithFontSize:Zoom(14) weight:1 color:[RBThemeConfig textBlackColor] align:1 text:[NSString stringWithFormat:@"版本号:%@", version]];
        [self.view view_addView:view withHeight:CGFLOAT_MIN width:kRBMainScreenWidth top:Zoom(13) bottom:CGFLOAT_MIN left:0 right:0 centerX:0];
        
    }
    {
        UIView *view = UIView.new;
        [view rbAddTapGesWithTarget:self action:@selector(enIntroBtnTapped)];
        
        UILabel *textL = [RanTool labelWithFontSize:Zoom(15) weight:1 color:[RBThemeConfig textBlackColor] align:1 text:@"企业介绍"];
        [view addSubview:textL];
        [textL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(Zoom(19));
            make.centerY.mas_equalTo(0);
        }];
     
        UIImageView *imgView = [RanTool imgViewWithMode:1 radius:0 imgName:@"mine_arrow_right"];
        [view addSubview:imgView];
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-Zoom(16));
            make.width.mas_equalTo(Zoom(7));
            make.height.mas_equalTo(Zoom(13));
            make.centerY.mas_equalTo(0);
        }];
        
        [self.view view_addView:view withHeight:Zoom(54) width:kRBMainScreenWidth top:Zoom(35) bottom:CGFLOAT_MIN left:0 right:0 centerX:0];
    }
    {
        UIView *view = UIView.new;
        
        UILabel *textL = [RanTool labelWithFontSize:Zoom(15) weight:1 color:[RBThemeConfig textBlackColor] align:1 text:@"版本更新"];
        [view addSubview:textL];
        [textL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(Zoom(19));
            make.centerY.mas_equalTo(0);
        }];
     
        UILabel *tipL = [RanTool labelWithFontSize:Zoom(15) weight:1 color:[RBThemeConfig textGrayColor] align:0 text:@"当前已为最新版本"];
        [view addSubview:tipL];
        [tipL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-Zoom(16));
            make.centerY.mas_equalTo(0);
        }];
        
        [self.view view_addView:view withHeight:Zoom(54) width:kRBMainScreenWidth top:0 bottom:CGFLOAT_MIN left:0 right:0 centerX:0];
    }
    
    {
        UILabel *view = UILabel.new;
        [self.view addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(-Zoom(52));
            make.centerX.mas_equalTo(0);
        }];
        view.numberOfLines = 0;
        NSMutableAttributedString *stringM = NSMutableAttributedString.new;
        UIColor *color = [UIColor colorWithHexString:@"#255DD9"];
        UIFont *font = [UIFont systemFontOfSize:Zoom(13) weight:UIFontWeightMedium];
        CGFloat lineSpacing = Zoom(12);
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@"版权信息" highlighBgColor:nil highlightColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
            
        } longPressAction:nil];
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@" | " highlighBgColor:nil highlightColor:nil tapAction:nil longPressAction:nil];
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@"证照信息" highlighBgColor:nil highlightColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
            
        } longPressAction:nil];
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@"\n" highlighBgColor:nil highlightColor:nil tapAction:nil longPressAction:nil];
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@"《软件许可使用协议》" highlighBgColor:nil highlightColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
            
        } longPressAction:nil];
        [stringM appendFont:font color:color lineSpacing:lineSpacing text:@"《淘宝平台服务协议》" highlighBgColor:nil highlightColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
            
        } longPressAction:nil];
        view.attributedText = stringM;
        view.textAlignment = NSTextAlignmentCenter;
    }
}

#pragma mark - Network

- (void)getData {
    NSString *urlString = @"";
    [LCNetWork LCRequest_Get:urlString HUD:YES parameters:nil success:^(NSDictionary * _Nonnull parma, NSDictionary * _Nonnull dic, NSString * _Nonnull url, NSString * _Nonnull Json) {
            
    } fail:^(NSError * _Nonnull error, NSString * _Nonnull url) {
    }];
}

#pragma mark - Event

- (void)enIntroBtnTapped
{
    
}

#pragma mark - Setter

#pragma mark - Getter

@end
